package com.chen.positioning.user.dao;

import com.chen.positioning.user.entity.UserManagement;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户管理
 */
@Mapper
public interface UserManagementMapper {
    /**
     * 检测用户名是否可用
     * @param username
     * @return
     */
    public int checkUserName(String username)  throws Exception ;
    /**
     * 注册用户
     * @param userManagement
     * @return
     */
    public int insertUserMangement(UserManagement userManagement)  throws Exception;

    /**
     * 用户登录
     * @param userManagement
     * @return
     */
    public UserManagement userLogin(UserManagement userManagement)  throws Exception;

    /**
     * 根据用户Id实时查询用户余额是否够
     * @param userId
     * @return
     */
    public UserManagement findAllUserManagementInfo(Integer userId)  throws Exception;

    /**
     * 使用完定位服务后扣除其余额(vip不扣除)
     * @param userId
     * @return
     */
    public int updateBalanceByUserId(Integer userId,double blance)  throws Exception;
}